<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script>
			//闭包函数
			for(var i=0;i<6;i++){
				
				setTimeout(function(){
					document.write(i+"</br>");
				},1);
				
				
				
				//4 setTimeout(function(){
				// 	document.write(i+"</br>");
				// },1);
				
				
				//3 function f1(){
				// 	document.write(i+"</br>");
				// }
				// setTimeout(f1(),5000);
				
				
			//2 setTimeout(document.write(i+"</br>"),5000);
		}
			//1 setTimeout(document.write(2+"</br>"),5000);
			
			
			
		</script>
	</body>
</html>
